﻿/* 
	PureMVC CSharp / WPF / EmployeeAdmin Demo - Login
	By Andy Adamczak <andy.adamczak@puremvc.org>
	Copyright(c) 2009 Andy Adamczak, Some rights reserved.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using PureMVC.Patterns;
using PureMVC.Interfaces;


using GEF2.Model.Storage;
using GEF2.Model;
using GEF2;

namespace GEF2.Controller
{
    public class DeleteEntityCommand : SimpleCommand, ICommand
    {
        public override void Execute(INotification notification)
        {
            EntityProxy entityProxy = (EntityProxy)Facade.RetrieveProxy(EntityProxy.NAME);
            Entity entity = (Entity)notification.Body;

            entityProxy.DeleteEntity(entity);
            SendNotification(ApplicationFacade.ENTITY_DELETED);
        }
    }
}
